/**
 * 
 */
package br.com.lazyprogrammer.worldsoccermanager.network;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * 
 * @author Limao Games <br />
 * <b>Email:</b> andreikeda@limaogames.com.br <br />
 * created on: 07/05/2014
 * @version 1.0
 * @see 
 */
public class Network {

	public static boolean isOnline(Context context) {
		try {
			ConnectivityManager connManager = (ConnectivityManager) context
					.getSystemService(Context.CONNECTIVITY_SERVICE);
			NetworkInfo mWifi = connManager
					.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
			NetworkInfo m3G = connManager
					.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
			return (mWifi.isConnected() || m3G.isConnected());
		} catch (Exception e) {
			return false;
		}
	}
	
}
